<template>
  <div class="main">
    <h1>type:{{ type }}</h1>
    <div class="main-default">
      <!-- 可写默认值当index.vue中默认插槽没值展示 -->
      <slot :num3="data.num3">可写默认值</slot>
    </div>
    <slot name="name1" :num1="data.num1"></slot>
    <slot name="name2" :num2="data.num2"></slot>
  </div>
</template>

<script>
export default {
  name: 'slot-main'
}
</script>
<script setup>
import { reactive, defineProps } from 'vue'
const data = reactive({
  num1: 1,
  num2: 2,
  num3: 3
})
defineProps({
  type: {
    type: String,
    default: ''
  }
})

</script>
<style lang="scss" scoped>

</style>
